<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <title>满意度测评系统</title>
    <link rel="shortcut icon" href="/static/images/favicon.ico"/>
    #include('cdn/cdn.html')
    <link rel="stylesheet" href="/static/style/css/header.css">
    <link rel="stylesheet" href="/static/style/css/all-style.css">

    <script>
        $(document).ajaxStart(function () {
            $('#loading').removeClass('hidden');
        }).ajaxStop(function () {
            $('#loading').addClass('hidden');
        });
    </script>
    <style>
        .dropdown-menu > li > a {
            padding: 6px 20px;
        }
    </style>
</head>
<body class="skin-blue">
    <header>
        <a class="logo">满意度测评系统</a>
        <div class="header-nav">
            #if(user)
                <span class="label label-xs label-success">欢迎: <strong>${user.realName ?! '游客'}</strong></span>
            #end
            <div class="dropdown pull-right">
                <button class="btn btn-xs btn-warning dropdown-toggle" data-toggle="dropdown">
                    <span class="fa fa-gear"></span>菜单
                </button>
                <ul class="dropdown-menu dropdown-menu-right">
                    #if(user)
                        <li><a href="/user/change"><span class="fa fa-eyedropper"></span>&nbsp;修改信息</a></li>
                        <li><a href="/user/change_mm"><span class="fa fa-unlock-alt"></span>&nbsp; 修改密码</a></li>
                        <li class="logout"><a href="javascript:"><span class="fa fa-sign-out"></span>&nbsp;注销</a></li>
                    #else
                        <li><a href="/user/login"><span class="fa fa-user"></span>&nbsp;&nbsp;登录</a></li>
                    #end
                </ul>
            </div>
        </div>
    </header>

    <nav class="body-nav">
        <div class="btns">
            #if(user)
                <a href="/user/home" class="btn btn-primary">主页 <span class="fa fa-home"></span></a>
                #--<a href="/user/record" class="btn btn-success">记录 <span class="fa fa-file-text"></span></a>
                <a href="/user/rank" class="btn btn-danger">排名 <span class="fa fa-list-ol"></span></a>--#
            #else
                <a href="/user/login" class="btn btn-primary">登录 <span class="fa fa-sign-in"></span></a>
                <a href="/user/register" class="btn btn-warning">注册 <span class="fa fa-plus-circle"></span></a>
                <a href="/user/about" class="btn btn-success">关于 <span class="fa fa-info-circle"></span></a>
            #end
        </div>
    </nav>

    <script>
        $('.logout').click(function (e) {
            $.post('/user/logout', function (data) {
                if (data.success){
                    alert('SUCCESS: 注销成功');
                    location.href = "/user/login";
                }
            });
        });
    </script>